package com.ying.po.order;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@ApiModel("包装信息")
@Entity
@Table(name = "t_wrap")
@DynamicInsert
@DynamicUpdate
public class Wrap implements Serializable {

    @ApiModelProperty(value = "主键", example = "1")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Integer id;

    @ApiModelProperty(value = "包装类型")
    @Column(name = "type")
    private String type;

    @ApiModelProperty("包装价格")
    @Column(name = "price")
    private BigDecimal price;

    @ApiModelProperty("某个时间的包装价格")
    @Column(name = "date")
    @JsonFormat(pattern = "yyyy")
    private Date date;

    @ApiModelProperty(value = "是否删除")
    @Column(name = "is_delete")
    private Integer isDelete;

    @ApiModelProperty(value = "系统用户ID")
    @Column(name = "user_id")
    private Integer userId;

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Wrap{" +
                "id=" + id +
                ", type='" + type + '\'' +
                ", price=" + price +
                ", date=" + date +
                ", isDelete=" + isDelete +
                ", userId=" + userId +
                '}';
    }
}
